package com.xiaochong.tir.api.component.actor;

import akka.actor.UntypedActor;
import com.xc.logclient.bo.TraceLine;
import com.xc.logclient.utils.LogTrace;
import com.xiaochong.tir.api.service.TokenIndexRankService;
import com.xiaochong.tir.api.util.SpringContextUtil;

import java.util.Map;

/**
 * Created by org on 2018/5/12.
 * 通证指数5分钟跑一次
 */
public class AkkaTokenIndexRankGrailWeightIndustryFive extends UntypedActor{
    /**
     * 大盘、行业、权重
     */
    private TokenIndexRankService tokenIndexRankService =
            (TokenIndexRankService) SpringContextUtil.getBean("tokenIndexRankService");


    @Override
    public void onReceive(Object o) throws Exception {
        LogTrace.beginTrace("大盘");
        Long start = System.currentTimeMillis();
        //大盘
        tokenIndexRankService.MakeGrailIndexToCache();
        //权重
        tokenIndexRankService.MakeWeightIndexToCache();
        //行业
        tokenIndexRankService.MakeIndustryToCacheOf();
        LogTrace.info("Akka大盘、行业、权重5分钟存入redis","Akka大盘、行业、权重耗时",String.valueOf(System.currentTimeMillis()-start));
    }
}
